﻿<!DOCTYPE html>
<html>
<head>
    <title>CGI</title>
</head>
<body>
    <h1>Our Page</h1>
    <!--01-->
    <script>
        var total = 99.99;
        var freeShipping;
        if (total >= 100.00)
            freeShipping = true;
        else
            freeShipping = false;
        console.log(freeShipping);
    </script>
    <!--02-->
    <!--<script>
        var total = 99.99;
        var freeShipping;
        var savings;
        if (total >= 100.00) {
            freeShipping = true;
            savings = 29.99;
        }
        else {
            freeShipping = false;
            savings = 0;
        }
        console.log(savings);
    </script>-->
    <!--03-->
    <!--<script>
        var orderType = 'business';
        var shipMethod;
        if (orderType == 'business')
            shipMethod = 'FedEx';
        else if (orderType == 'personal')
            shipMethod = 'UPS Ground';
        else
            shipMethod = 'USPS';
        console.log(shipMethod);
    </script>-->
    <!--04 &check break-->
    <!--<script>
        var orderType = 'business';
        var shipMethod;
        switch (orderType) {
            case 'business':
                shipMethod = 'FedEx';
                break;
            case 'personal':
                shipMethod = 'UPS Ground';
                break;
            default:
                shipMethod = 'USPS';
        }
        console.log(shipMethod);
    </script>-->
    <!--05 & check out by removing default block-->
    <!--<script>
        var orderType = 'unknown';
        var shipMethod;
        switch (orderType) {
            case 'business':
            case 'personal':
                shipMethod = 'UPS Ground';
                break;
            default:
                shipMethod = 'USPS';
        }
        console.log(shipMethod);
    </script>-->
    <!--06 unique,not in c, c#-->
    <!--<script>
        var orderTotal = 99.99;
        var discount;
        switch (true) {
            case orderTotal >= 50 && orderTotal < 75:
                discount = 10;
                break;
            case orderTotal >= 75 && orderTotal < 100:
                discount = 20;
                break;
            case orderTotal >= 100:
                discount = 30;
                break;
            default:
                discount = 0;
        }
        console.log(discount);
    </script>-->
</body>
</html>